<template>
	<view>
		<!-- 无门槛 -->
		<view class="" v-if="itemType==0" style="box-sizing: border-box;margin-top: 20rpx;width: 100%;background-color: #f5f5f5;padding:20rpx;border-radius: 10rpx;">
			<view class="" style="margin-bottom: 20rpx;width: 100%;display: flex;justify-content: space-between;align-items: center;">
				<view class="">
					<!-- <image></image> -->
					<span>奖品类型:无门槛券</span>
				</view>
				<view class="smallBtn" @click="deleteClick">
					删除
				</view>
			</view>
			<uni-forms :value="coupons" ref="form" class="uni-forms" err-show-type="undertext">
				<uni-forms-item label="优惠金额" name="amount">
					<view class="input-box1">
						<uni-easyinput :inputBorder="false" required type="number" value="" v-model="coupons.amount" placeholder-class="input-placehold"
						 placeholder="请输入优惠金额" @blur="judgeAmount" />
					</view>
				</uni-forms-item>

				<uni-forms-item name="count" label="奖品数量">
					<view class="input-box1">
						<uni-easyinput :inputBorder="false" required type="number" value="" v-model="coupons.count" placeholder-class="input-placehold"
						 placeholder="请输入奖品数量" @blur="judgeTypeCount" />
					</view>
				</uni-forms-item>
				<uni-forms-item label="中奖概率(%)" name="probability">
					<view class="input-box1">
						<uni-easyinput :inputBorder="false" required type="number" value="" v-model="coupons.probability"
						 placeholder-class="input-placehold" @blur="inputProbability" placeholder="请输入获奖概率百分比" />
					</view>
				</uni-forms-item>

				<uni-forms-item label="使用期限" name="deadline">
					<view class="input-box1">
						<view class="" style="border: 1px solid #C3C3C3;display: flex;align-items: center;height: 62rpx;width: 207rpx;padding: 0 10rpx;box-sizing: border-box;border-radius: 6rpx;">
							<uni-easyinput required :inputBorder="false" style="flex:1" v-model="coupons.deadline" type="number" value=""
							 placeholder-class="input-placehold" placeholder="请输入" @blur="judgeDeadline" />
							<span>天内</span>
						</view>
					</view>
				</uni-forms-item>
				<uni-forms-item label="中奖限制" name="limitCount">
					<view class="input-box1">
						<span>每人可中</span>
						<view class="" style="border: 1px solid #C3C3C3;display: flex;align-items: center;height: 62rpx;width: 187rpx;padding: 0 10rpx;box-sizing: border-box;border-radius: 6rpx;">
							<uni-easyinput required type="number" :inputBorder="false" value="" v-model="coupons.limitCount"
							 placeholder-class="input-placehold" placeholder="请输入" @blur="judgeLimitCount" />
							<span>次</span>
						</view>
					</view>
				</uni-forms-item>
			</uni-forms>
		</view>

		<!-- 红包 -->
		<view class="" v-else-if="itemType==1" style="box-sizing: border-box ;margin-top: 20rpx;width: 100%;background-color: #f5f5f5;padding:20rpx;border-radius: 10rpx;">
			<view class="" style="width: 100%;display: flex;justify-content: space-between;align-items: center;">
				<view class="">
					<span>奖品类型:红包</span>
				</view>
				<view class="smallBtn" @click="deleteClick">
					删除
				</view>
			</view>
			<uni-forms :value="cashs" ref="cashsForm" class="uni-forms" validate-trigger="bind" err-show-type="undertext">
				<uni-forms-item label="红包额度" name="amount">
					<view class="input-box1">
						<uni-easyinput :inputBorder="false" required type="number" value="" v-model="cashs.amount" placeholder-class="input-placehold"
						 placeholder="请输入红包额度" @blur="judgeCoin" />
					</view>
				</uni-forms-item>
				<view class="input-box1">
					<span style="flex:1">红包派发方式</span>
					<view class="" style="display: flex; justify-content: flex-end;align-items: center;">
						<radio-group @change="radioChange2">
							<label>
								<radio value="1" checked="true" /><text>随机</text>
							</label>
							<label>
								<radio value="2" /><text>平均分配</text>
							</label>
						</radio-group>
					</view>
				</view>

				<uni-forms-item label="红包数量" name="count">

					<view class="input-box1">
						<uni-easyinput :inputBorder="false" required type="number" value="" v-model="cashs.count" placeholder-class="input-placehold"
						 placeholder="请输入红包数量" @blur="judgeTypeCount" />
					</view>
				</uni-forms-item>

				<uni-forms-item label="中奖概率(%)" name="probability">
					<view class="input-box1">
						<uni-easyinput :inputBorder="false" required type="number" value="" v-model="cashs.probability" placeholder-class="input-placehold"
						 placeholder="请输入获奖概率百分比" @blur="inputProbability" />
					</view>
				</uni-forms-item>

				<uni-forms-item label="中奖限制" name="limitCount">

					<view class="input-box1">
						<!-- <span>中奖限制</span> -->
						<span>每人可中</span>
						<view class="" style="border: 1px solid #C3C3C3;display: flex;align-items: center;height: 62rpx;width: 207rpx;padding: 0 10rpx;box-sizing: border-box;border-radius: 6rpx;">
							<!-- <uni-easyinput :inputBorder="false" required type="number" value="" v-model="cashs.limitCount" placeholder-class="input-placehold"
							 placeholder="请输入" /> -->
							<input style="flex:1" type="number" v-model="cashs.limitCount" value="" placeholder-class="input-placehold"
							 placeholder="请输入" @blur="judgeLimitCount" />
							<span>次</span>
						</view>
					</view>
				</uni-forms-item>
			</uni-forms>
		</view>

		<!-- 一束花 -->
		<view class="" v-else style="box-sizing: border-box ;margin-top: 20rpx;width: 100%;background-color: #f5f5f5;padding:20rpx;border-radius: 10rpx;">

			<view class="" style="width: 100%;display: flex;justify-content: space-between;align-items: center;">
				<view class="" style="flex:1">
					<span>奖品类型:自定义商品</span>
					<!-- <input type="text" placeholder="商品名称 请输入奖品名称" style="font-size: 28rpx;width:100%" v-model="commoditys.name" placeholder-style="color:#c0c0c0;font-size: 28rpx;flex:1"> -->
				</view>
				<view class="smallBtn" @click="deleteClick">
					删除
				</view>
			</view>
			<!-- 列表 -->
			<!-- 中奖数量\奖品总数量\中奖概率\使用期限\中奖限制 -->

			<uni-forms :value="commoditys" ref="commoditysForm" class="uni-forms" validate-trigger="bind" err-show-type="undertext">
				<uni-forms-item label="奖品名称" name="name">
					<view class="input-box1">
						<uni-easyinput style="flex:1" :inputBorder="false" required type="text" value="" v-model="commoditys.name"
						 placeholder-class="input-placehold" placeholder="请输入奖品名称" />
					</view>
				</uni-forms-item>

				<uni-forms-item label="中奖数量" name="lotteryCount" v-if="preferentialType==1">
					<view class="input-box1">
						<uni-easyinput style="flex:1" :inputBorder="false" required type="number" value="" v-model="commoditys.lotteryCount"
						 placeholder-class="input-placehold" placeholder="请输入每次中奖获得的数量" @blur="judgeTypeCount" />
					</view>
				</uni-forms-item>

				<uni-forms-item label="奖品总数量" name="count">
					<view class="input-box1">
						<!-- <span>奖品总数量</span> -->
						<uni-easyinput :inputBorder="false" required type="number" value="" v-model="commoditys.count" placeholder-class="input-placehold"
						 placeholder="请输入奖品总数量" @blur="judgeCount" />
					</view>
				</uni-forms-item>

				<view class="input-box1">
					<span>奖品规格</span>
					<input type="text" v-model="commoditys.norm" style="width: 70%;" value="" placeholder-class="input-placehold"
					 placeholder="自定义输入 例：件/个/瓶/次/" />
				</view>

				<!-- 金蛋 -->
				<uni-forms-item v-if="preferentialType==1" label="中奖概率" name="probability">
					<view class="" style="width: 100%;display: flex;height: 100rpx;align-items: center;border-bottom: 1rpx solid #FAFAFA;">
						<!-- <span>中奖概率(%)</span> -->
						<span>每</span>
						<view class="" style="margin: 0 10rpx;border: 1px solid #C3C3C3;display: flex;align-items: center;height: 62rpx;padding: 0 10rpx;box-sizing: border-box;border-radius: 6rpx;width: 150rpx;">
							<uni-easyinput style="flex:1" :inputBorder="false" required v-model="commoditys.probability" type="number" value=""
							 placeholder-class="input-placehold" placeholder="多少人" @blur="inputEggProbability" />
						</view>
						<span>必中一个</span>

						<!-- <uni-easyinput type="number" :inputBorder="false" required value="" v-model="commoditys.probability"
						 placeholder-class="input-placehold" @blur="inputProbability" placeholder="请输入获奖概率百分比" /> -->
					</view>
				</uni-forms-item>

				<!-- 转盘 -->
				<uni-forms-item v-else label="中奖概率(%)" name="probability">
					<view class="input-box1">
						<!-- <span>中奖概率(%)</span> -->
						<!-- <view class="" style="border: 2rpx solid #C3C3C3;display: flex;align-items: center;height: 62rpx;width: 320rpx;padding: 0 10rpx;box-sizing: border-box;border-radius: 6rpx;">
							<uni-easyinput style="flex:1" :inputBorder="false" required v-model="commoditys.probability" type="number" value=""
							 placeholder-class="input-placehold" placeholder="请输入" @blur="inputProbability" />
							<span>次必中1件奖品</span>
						</view> -->
						<uni-easyinput type="number" :inputBorder="false" required value="" v-model="commoditys.probability"
						 placeholder-class="input-placehold" @blur="inputProbability" placeholder="请输入获奖概率百分比" />
					</view>
				</uni-forms-item>

				<uni-forms-item label="使用期限" name="deadline">
					<view class="input-box1">
						<!-- <span>使用期限</span> -->
						<view class="" style="border: 2rpx solid #C3C3C3;display: flex;align-items: center;height: 62rpx;width: 207rpx;padding: 0 10rpx;box-sizing: border-box;border-radius: 6rpx;">
							<uni-easyinput style="flex:1" :inputBorder="false" required v-model="commoditys.deadline" type="number" value=""
							 placeholder-class="input-placehold" placeholder="请输入" @blur="judgeDeadline" />
							<span>天内</span>
						</view>
					</view>
				</uni-forms-item>

				<view class="input-box1" v-if="preferentialType==2">
					<span style="flex:1">领取设置</span>
					<view class="" style="display: flex; justify-content: flex-end;align-items: center;">
						<radio-group @change="radioChange1">
							<label>
								<radio value="1" checked="true" /><text>快递</text>
							</label>
							<label>
								<radio value="2" /><text>到店自取</text>
							</label>
						</radio-group>
					</view>
				</view>
				<view v-if="preferentialType==2" class="" style="width: 100%;height: 100rpx;display: flex;justify-content: space-around;align-items: center;">
					<span>每</span>
					<input type="number" v-model="commoditys.receiveInterval" style="width: 20%;height: 62rpx;rpx;border: 2rpx solid #c0c0c0;border-radius: 6rpx;"
					 placeholder="请输入" @click="onFocus" :disabled="commoditys.receiveType==1" placeholder-style="font-size:28rpx;margin-left:10rpx">
					<span>日可兑换</span>
					<input type="number" v-model="commoditys.receiveCount" style="width: 20%;height: 62rpx;border: 2rpx solid #c0c0c0;border-radius: 6rpx;"
					 value="" placeholder="请输入" @click="onFocus" :disabled="commoditys.receiveType==1" placeholder-style="font-size:28rpx;margin-left:10rpx" />
				</view>
				<view class="input-box1">
					<span>联系方式</span>
					<input type="text" v-model="commoditys.receiveTel" placeholder-class="input-placehold" placeholder="请输入联系方式">

				</view>
				<view class="input-box1">
					<span>领奖地址</span>
					<input type="text" v-model="commoditys.receiveAddress" placeholder-class="input-placehold" placeholder="请输入领奖地址">

				</view>
				<uni-forms-item label="中奖限制" name="limitCount">

					<view class="input-box1">
						<!-- <span>中奖限制</span> -->
						<span>每人可中</span>
						<view class="" style="border: 1px solid #C3C3C3;display: flex;align-items: center;height: 62rpx;width: 207rpx;padding: 0 10rpx;box-sizing: border-box;border-radius: 6rpx;">
							<uni-easyinput :inputBorder="false" required style="flex:1" v-model="commoditys.limitCount" type="number" value=""
							 placeholder-class="input-placehold" placeholder="请输入" @blur="judgeLimitCount" />
							<span>次</span>
						</view>
					</view>
				</uni-forms-item>

			</uni-forms>
		</view>

	</view>
</template>

<script>
	import {
		mapState,
		mapMutations,
		mapGetters
	} from 'vuex';
	export default {
		props: {
			preferentialType: {
				type: Number,
				default: 2, //1 砸金蛋 2 幸运大转盘
			},
			itemType: {
				type: Number,
				default: 0
			},
			nowIndex: {
				type: Number,
				default: 0
			},
			goldEggData: {
				type: Object,
				default () {
					return {}
				}
			}

		},

		data() {
			return {
				// 自定义商品规则
				commoditysForm: {

					lotteryCount: {
						rules: [{
							required: true,
							errorMessage: '不能为空',
						}, {
							format: 'number',
							errorMessage: '必须为数字'

						}, {
							validateFunction: function(rule, value, data, callback) {
								// if (value > 0 && (String(value).indexOf(".") + 1) <= 0) {
								// 	return true
								// } else {
								// 	callback("金额不可以为0且须为1的整数倍")
								// }
								return true

							}
						}]
					},
					deadline: {
						rules: [{
							format: 'number',
							errorMessage: '必须为数字'
						}, {
							required: true,
							errorMessage: '使用期限不能为空',
						}, {
							validateFunction: function(rule, value, data, callback) {

								if (value > 0 && (String(value).indexOf(".") + 1) <= 0) {
									return true
								} else {
									callback("天数不可为 0")
								}
							}
						}]
					},
					count: {
						rules: [{
							format: 'number',
							errorMessage: '必须为数字'
						}, {
							required: true,
							errorMessage: '奖品数量必须大于或等于1且1的整数倍',
						}, {
							validateFunction: function(rule, value, data, callback) {
								if (value > 0 && (String(value).indexOf(".") + 1) <= 0) {
									return true
								} else {
									callback("奖品数量不可以为0且须为1的整数倍")
								}

							}
						}]
					},
					limitCount: {
						rules: [{
							format: 'number',
							errorMessage: '必须为数字'
						}, {
							required: true,
							errorMessage: '中奖限制不能为空',
						}, {
							validateFunction: function(rule, value, data, callback) {
								if (value > 0 && (String(value).indexOf(".") + 1) <= 0) {
									return true
								} else {
									callback("中奖限制不可以为0且须为1的整数倍")
								}

							}
						}]
					},
					probability: {
						rules: [{
							required: true,
							errorMessage: '中奖概率必须填写',
						}, {
							validateFunction: function(rule, value, data, callback) {
								if (value > 0 && value <= 100) {
									return true
								} else {
									callback("中奖概率不可为0")
								}

							}
						}]
					}

				},
				cashsRules: {
					amount: {
						rules: [{
							required: true,
							errorMessage: '不能为空',
						}, {
							format: 'number',
							errorMessage: '必须为数字'


						}]
					},
					// deadline: {
					// 	rules: [{
					// 		format: 'number',
					// 		errorMessage: '必须为数字'
					// 	}, {
					// 		required: true,
					// 		errorMessage: '使用期限不能为空',
					// 	}, {
					// 		validateFunction: function(rule, value, data, callback) {

					// 			if (value > 0 && (String(value).indexOf(".") + 1) <= 0) {
					// 				return true
					// 			} else {
					// 				callback("使用期限不可以为0且须为1的整数倍")
					// 			}
					// 		}
					// 	}]
					// },
					count: {
						rules: [{
							format: 'number',
							errorMessage: '必须为数字'
						}, {
							required: true,
							errorMessage: '奖品数量必须大于或等于1且1的整数倍',
						}, {
							validateFunction: function(rule, value, data, callback) {
								if (value > 0 && (String(value).indexOf(".") + 1) <= 0) {
									return true
								} else {
									callback("奖品数量不可以为0且须为1的整数倍")
								}

							}
						}]
					},
					limitCount: {
						rules: [{
							format: 'number',
							errorMessage: '必须为数字'

						}, {
							required: true,
							errorMessage: '中奖限制不能为空',
						}, {
							validateFunction: function(rule, value, data, callback) {
								if (value > 0 && (String(value).indexOf(".") + 1) <= 0) {
									return true
								} else {
									callback("中奖限制不可以为0且须为1的整数倍")
								}

							}
						}]
					},
					probability: {
						rules: [{
							required: true,
							errorMessage: '中奖概率必须填写',
						}, {
							validateFunction: function(rule, value, data, callback) {
								if (value > 0 && value <= 100) {
									return true
								} else {
									callback("中奖概率不可为0")
								}
							}
						}]
					}
				},
				couponsRules: {
					amount: {
						rules: [{
							required: true,
							errorMessage: '不能为空',
						}, {
							format: 'number',
							errorMessage: '必须为数字'

						}]
					},
					deadline: {
						rules: [{
							format: 'number',
							errorMessage: '必须为数字'
						}, {
							required: true,
							errorMessage: '使用期限不能为空',
						}, {
							validateFunction: function(rule, value, data, callback) {

								if (value > 0 && (String(value).indexOf(".") + 1) <= 0) {
									return true
								} else {
									callback("天数不可为 0")
								}
							}
						}]
					},
					count: {
						rules: [{
							format: 'number',
							errorMessage: '必须为数字'
						}, {
							required: true,
							errorMessage: '奖品数量必须大于或等于1且1的整数倍',
						}, {
							validateFunction: function(rule, value, data, callback) {
								if (value > 0 && (String(value).indexOf(".") + 1) <= 0) {
									return true
								} else {
									callback("奖品数量不可以为0且须为1的整数倍")
								}

							}
						}]
					},
					limitCount: {
						rules: [{
							format: 'number',
							errorMessage: '必须为数字'
						}, {
							required: true,
							errorMessage: '中奖限制不能为空',
						}, {
							validateFunction: function(rule, value, data, callback) {
								if (value > 0 && (String(value).indexOf(".") + 1) <= 0) {
									return true
								} else {
									callback("中奖限制不可以为0且须为1的整数倍")
								}

							}
						}]
					},
					probability: {
						rules: [{
							required: true,
							errorMessage: '中奖概率必须填写',
						}, {
							validateFunction: function(rule, value, data, callback) {
								if (value > 0 && value <= 100) {
									return true
								} else {
									callback("中奖概率仅可以为0～100")
								}

							}
						}]
					}
				},
				coupons: {
					amount: "", //金额
					deadline: "", //期限 天
					count: "", //总数量
					limitCount: "", //中奖限制
					probability: "", //中奖概率
					eggType: 0
				},
				cashs: { //红包
					amount: "",
					limitCount: "",
					count: "", //总数量
					probability: "",
					type: 1, // 发放方式 1.随机 2.平均
					eggType: 1
				},
				commoditys: { //奖品
					count: "", //总数量  
					deadline: "", //期限 天
					info: '', //商品介绍
					limitCount: "", //中奖限制
					lotteryCount: "", //中奖数量
					name: '', //奖品名称
					norm: '', //规格
					probability: "", //中奖概率
					receiveAddress: '', //领取地址
					receiveCount: "", //领取数量
					receiveInterval: "", //领取间隔
					receiveTel: '', //联系电话
					receiveType: 1, //领取方式 1.快递 2.到店自取
					eggType: 2
				}

			};
		},

		onReady() {

			if (this.goldEggData.eggType == 0) {
				// this.$refs.form.setRules(this.couponsRules)
				this.coupons = this.goldEggData;
			} else if (this.goldEggData.eggType == 1) {
				this.cashs = this.goldEggData;
				// this.$refs.cashsForm.setRules(this.cashsRules)
			} else {
				this.commoditys = this.goldEggData;
				// this.$refs.commoditysForm.setRules(this.commoditysForm)
			}
		},
		computed: {
			...mapGetters(['userCoin']),
		},
		watch: {
			goldEggData(newValue, oldValue) {
				console.log('newValue', newValue)
				if (newValue.eggType == 0) {
					// this.$refs.form.setRules(this.couponsRules)
					this.coupons = newValue;
				} else if (newValue.eggType == 1) {
					this.cashs = newValue;
					// this.$refs.cashsForm.setRules(this.cashsRules)
				} else {
					this.commoditys = newValue;
					// this.$refs.commoditysForm.setRules(this.commoditysForm)
				}
			}
		},

		methods: {

			onFocus() {
				if (this.commoditys.receiveType == 1) {
					uni.showToast({
						title: '只有到店领取可设置',
						icon: 'none'
					})
				}


			},

			// 判断优惠金额
			judgeAmount(e) {
				var v = e.detail.value; //优惠金额
				if (Number(v) <= 1) {
					uni.showToast({
						title: '优惠金额必须大于 1',
						icon: 'none'
					})
					this.coupons.amount = ""
				}

			},
			// 判断总数量是否大于中奖数量
			judgeCount(e) {

				var v = e.detail.value; //奖品总数量
				if (Number(v) < Number(this.commoditys.lotteryCount) || v == 0) {
					var that = this;
					uni.showModal({
						title: '输入失败',
						content: '您输入的总数量不可为0且要大于等于中奖数量',
						showCancel: false,
						success: () => {
							that.commoditys.count = '';
						}
					})
				}
			},

			// 判断输入的红包金额
			judgeCoin(e) {
				var v = e.detail.value;
				console.log(v, this.userCoin)

				if (v < 1) {
					uni.showToast({
						title: '红包额度需大于等于1',
						icon: 'none'
					})
					this.cashs.amount = '';
				}

				if (v > this.userCoin) {
					var that = this;
					uni.showModal({
						title: '输入失败',
						content: '您的余额不足，请尽快充值',
						showCancel: true,
						success: (res) => {
							if (res.confirm) {
								uni.navigateTo({
									url: '../../user/mydep/mydep'
								})
							}

							that.cashs.amount = '';

						}
					})
				}
			},

			judgeLimitCount(e) {
				var v = e.detail.value;
				if (Number(v) < 1) {
					uni.showToast({
						title: `中奖限制必须大于等于1,请重新输入`,
						icon: 'none'
					})

					if (this.itemType == 0) {
						this.coupons.limitCount = ""
					} else if (this.itemType == 1) {
						this.cashs.limitCount = ""
					} else {
						this.commoditys.limitCount = ""
					}

				}
			},

			// 判断数量
			judgeTypeCount(e) {
				var v = e.detail.value;
				if (v == 0) {
					uni.showToast({
						title: '中奖数量不可为0或者空',
						icon: 'none'
					})
					if (this.itemType == 0) {
						this.coupons.count = ""
					} else if (this.itemType == 1) {
						this.cashs.count = ""
					} else {
						this.commoditys.lotteryCount = ""
					}

				}
			},
			// 金蛋中奖概率
			inputEggProbability(e){
				var num = Number(e.detail.value)
			
				if (num == 0) {
					uni.showToast({
						title: '请输入大于0的正整数',
						icon: 'none'
					})
				
					var itemType = this.itemType;
				
					switch (itemType) {
						case 0:
							this.coupons.probability = "";
							break;
						case 1:
							this.cashs.probability = "";
							break;
						case 2:
							this.commoditys.probability = "";
							break;
					}
				
				} else {
					// 中奖概率变化出发
					this.$emit('getProperty', {
						index: Number(this.nowIndex) - 1,
						property: Number(num)
					})
				}
			},
			// 中奖概率
			inputProbability(e) {
				var num = Number(e.detail.value)

				if (num > 100 || num <= 0) {
					uni.showToast({
						title: '中奖概率仅可以为0～100,请重新输入',
						icon: 'none'
					})

					var itemType = this.itemType;

					switch (itemType) {
						case 0:
							this.coupons.probability = "";
							break;
						case 1:
							this.cashs.probability = "";
							break;
						case 2:
							this.commoditys.probability = "";
							break;
					}

				} else {
					// 中奖概率变化出发
					this.$emit('getProperty', {
						index: Number(this.nowIndex) - 1,
						property: Number(num)
					})
				}
			},
			judgeDeadline(e) {
				var v = e.detail.value;
				if (v == 0) {
					uni.showToast({
						title: '使用期限不可为0',
						icon: 'none'
					})
					if (this.itemType == 0) {
						this.coupons.deadline = ""
					} else {
						this.commoditys.deadline = ""
					}

				}
			},
			deleteClick() {

				this.$emit("deleteItem", {
					index: this.nowIndex - 1
				})

			},
			//红包派发方式
			radioChange2(e) {
				this.cashs.type = e.detail.value

			},
			// 自定义商品
			radioChange1(e) {
				this.commoditys.receiveType = e.detail.value
				if (this.commoditys.receiveType == "1") {
					this.commoditys.receiveInterval = '';
					this.commoditys.receiveCount = ''
				}
			}
		}
	}
</script>

<style lang="scss">
	.uni-forms-item {
		margin-bottom: 14rpx !important;
		background-color: none;
	}

	.middleBtn {
		border: 1px solid #FFBE2D;
		border-radius: 10rpx;
		margin-right: 20rpx;
		padding: 10rpx 20rpx;
		box-sizing: border-box;
		background-color: #FFFFFF;
	}
</style>
